-module(quek_cp932).
-export([to_utf8/1, from_utf8/1, to_code/1, to_byte/1]).

to_utf8(Cp932) ->
    quek_cp932_utf8:conv(Cp932).

from_utf8(Utf8) ->
    quek_utf8_cp932:conv(Utf8).

to_code([B|T]) when B < 16#80 ->
    {B, T};
to_code([B1, B2|T]) ->
    {((B1 bsl 8) bor B2), T}.

to_byte(Code) when Code < 16#100 ->
    [Code];
to_byte(Code) ->
    [(Code bsr 8), (Code band 16#00FF)].
